package xml.uidElements.entry;

public class StructureSet extends AbstractStructure {

	private Structure structure;
	private int cardinalityMin;
	private int cardinalityMax;
	private boolean optional;

	public StructureSet(String name, String data) {
		structure = new Structure(name, data);
	}

	public void setCardinality(int cardinalityMin, int cardinalityMax) {
		this.setCardinalityMin(cardinalityMin);
		this.setCardinalityMax(cardinalityMax);

	}

	public void setCardinalityMax(int cardinalityMax) {
		this.cardinalityMax = cardinalityMax;
	}

	public int getCardinalityMax() {
		return cardinalityMax;
	}

	public void setCardinalityMin(int cardinalityMin) {
		this.cardinalityMin = cardinalityMin;
	}

	public int getCardinalityMin() {
		return cardinalityMin;
	}

	@Override
	public String getName() {
		return structure.getName();
	}

	public void setOptional(boolean optional) {
		this.optional = optional;
	}

	public boolean isOptional() {
		structure.setOptional(optional);
		return optional;
	}
	
	public void addDataEntry(DataEntryElement d) {
		structure.addDataEntry(d);
		
	}


}
